From 5277446646645a1477914df03e0e20905422e681 Mon Sep 17 00:00:00 2001 From: "kaf24@freefall.cl.cam.ac.uk" Date: Wed, 27 Oct 2004 13:32:42 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.288 (417fa37aiUr7WWjaJDqszVX8RYOFGA) Tiny bug fixes and cleanups. --- tools/libxc/xc_linux_build.c | 4 +-- xen/common/dom0_ops.c | 55 ++++++++++++++---------------------- xen/common/domain.c | 13 ++------- 3 files changed, 25 insertions(+), 47 deletions(-) diff --git a/tools/libxc/xc_linux_build.c b/tools/libxc/xc_linux_build.c index 8362fd1b70..cc4c0f4561 100644 --- a/tools/libxc/xc_linux_build.c +++ b/tools/libxc/xc_linux_build.c @@ -522,7 +522,7 @@ int xc_linux_build(int xc_handle, ctxt->cpu_ctxt.ss = FLAT_GUESTOS_DS; ctxt->cpu_ctxt.cs = FLAT_GUESTOS_CS; ctxt->cpu_ctxt.eip = vkern_entry; - ctxt->cpu_ctxt.esp = vstartinfo_start; + ctxt->cpu_ctxt.esp = vstartinfo_start + 2*PAGE_SIZE; ctxt->cpu_ctxt.esi = vstartinfo_start; ctxt->cpu_ctxt.eflags = (1<<9) | (1<<2); @@ -545,7 +545,7 @@ int xc_linux_build(int xc_handle, /* Ring 1 stack is the initial stack. */ ctxt->guestos_ss = FLAT_GUESTOS_DS; - ctxt->guestos_esp = vstartinfo_start; + ctxt->guestos_esp = vstartinfo_start + 2*PAGE_SIZE; /* No debugging. */ memset(ctxt->debugreg, 0, sizeof(ctxt->debugreg)); diff --git a/xen/common/dom0_ops.c b/xen/common/dom0_ops.c index 75de00b69d..f949c7d7af 100644 --- a/xen/common/dom0_ops.c +++ b/xen/common/dom0_ops.c @@ -100,14 +100,10 @@ long do_dom0_op(dom0_op_t *u_dom0_op) return -EPERM; if ( copy_from_user(op, u_dom0_op, sizeof(*op)) ) - { return -EFAULT; - } if ( op->interface_version != DOM0_INTERFACE_VERSION ) - { return -EACCES; - } TRACE_5D(TRC_DOM0OP_ENTER_BASE + op->cmd, 0, op->u.dummy[0], op->u.dummy[1], @@ -164,9 +160,9 @@ long do_dom0_op(dom0_op_t *u_dom0_op) case DOM0_CREATEDOMAIN: { - struct domain *d; - unsigned int pro; - domid_t dom; + struct domain *d; + unsigned int pro = 0; + domid_t dom; dom = op->u.createdomain.domain; if ( (dom > 0) && (dom < DOMID_FIRST_RESERVED) ) @@ -179,29 +175,20 @@ long do_dom0_op(dom0_op_t *u_dom0_op) break; if ( op->u.createdomain.cpu == -1 ) - { - /* Do an initial placement. Fix me for hyperthreading! */ - struct domain *d; - int i, j=0, c[smp_num_cpus]; - - pro=0; /* keep compiler happy */ - - for (i=0;iprocessor]++; - j++; - } - - for (i=0;iprocessor]++; + read_unlock_irq(&tasklist_lock); + + for ( i = 0; i < smp_num_cpus; i++ ) + if ( cnt[i] < cnt[pro] ) + pro = i; + } else pro = op->u.createdomain.cpu % smp_num_cpus; @@ -624,9 +611,9 @@ long do_dom0_op(dom0_op_t *u_dom0_op) break; } - if ( page->u.inuse.type_info & PGT_pinned ) - type |= LPINTAB; - l_arr[j] |= type; + if ( page->u.inuse.type_info & PGT_pinned ) + type |= LPINTAB; + l_arr[j] |= type; put_page(page); } else @@ -657,7 +644,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op) d = find_domain_by_id( op->u.setdomainmaxmem.domain ); if ( d != NULL ) { - vm_assist(d, op->u.setdomainvmassist.cmd, + vm_assist(d, op->u.setdomainvmassist.cmd, op->u.setdomainvmassist.type); put_domain(d); ret = 0; diff --git a/xen/common/domain.c b/xen/common/domain.c index 57e965c3ad..cbbd29c0cb 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -168,12 +168,12 @@ void domain_shutdown(u8 reason) if ( reason == 0 ) { - printk("Domain 0 halted: Our work here is done.\n"); + printk("Domain 0 halted: halting machine.\n"); machine_halt(); } else { - printk("Domain 0 shutdown: rebooting machine!\n"); + printk("Domain 0 shutdown: rebooting machine.\n"); machine_restart(0); } } @@ -207,15 +207,6 @@ unsigned int alloc_new_dom_mem(struct domain *d, unsigned int kbytes) /* initialise to machine_to_phys_mapping table to likely pfn */ machine_to_phys_mapping[page-frame_table] = alloc_pfns; - -#ifndef NDEBUG - { - /* Initialise with magic marker if in DEBUG mode. */ - void *a = map_domain_mem((page-frame_table)<id, PAGE_SIZE); - unmap_domain_mem(a); - } -#endif } return 0; -- 2.30.2